<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', 'PagesController@getIndex');

Route::get('/about', 'PagesController@getAbout');

Route::get('/contact', 'PagesController@getContact');
Route::post('/contact', 'PagesController@postContact');

Route::resource('/post', 'PostController');

Route::get('blog/{slug}', ['as'=>'blog.show', 'uses'=>'BlogController@getSignle'])
->where('slug','[\w\d\-\_]+');

Route::get('blog', 'BlogController@index');


/*********  auth  *****/
// Route::group(['middleware'=>'web'], function(){});
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', ['as' => 'login', 'uses' => 'Auth\AuthController@postLogin']);
Route::get('auth/logout', ['as' => 'logout', 'uses' => 'Auth\AuthController@getLogout']);

Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');

Route::get('auth/email', 'Auth\PasswordController@getEmail');
Route::post('auth/email', ['as' => 'mail', 'uses' => 'Auth\PasswordController@postEmail']);
Route::get('auth/reset/{token?}/', 'Auth\PasswordController@getReset');
Route::post('auth/reset', ['as' => 'reset', 'uses'=> 'Auth\PasswordController@postReset']);


/********   cate  *******/
Route::resource('category', 'CategoryController');


/********   tag  *******/
Route::resource('tag', 'TagController');


/********   comment  *******/
Route::resource('comment', 'CommentController');